namespace designpatternsplus.contracts
{
    #region

    using System;
    using System.Collections.Generic;
    using System.Runtime.Serialization;
    using System.ServiceModel;

    #endregion

    /// <summary>
    ///  Shopping Basket Interface
    /// </summary>
    [ServiceContract]
    public interface IShoppingCart : IDisposable, ICollection<IProductService>
    {
        /// <summary>
        /// Gets or sets the <see cref="IProductService"/> at the specified index.
        /// </summary>
        /// <value></value>
        IProductService this[int index] { get; set; }

        /// <summary>
        /// Using the predicate given find
        /// the master item record and add
        /// it to our cart
        /// </summary>
        /// <param name="criteria">The criteria.</param>
        IShoppingCart ScanProductBarCode(Func<ISkuDetails, bool> criteria);

        /// <summary>
        /// Usng the literal item we were given, add it to our cart
        /// </summary>
        /// <param name="Category">The item type request in.</param>
        void AddOne(ItemCategory Category);

        /// <summary>
        /// Indexes the of.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns></returns>
        int IndexOf(IProductService item);

        /// <summary>
        /// Inserts the specified index.
        /// </summary>
        /// <param name="index">The index.</param>
        /// <param name="item">The item.</param>
        void Insert(int index, IProductService item);

        /// <summary>
        /// Removes at.
        /// </summary>
        /// <param name="index">The index.</param>
        void RemoveAt(int index);

        IShoppingCart AutoScanDiscover(IEnumerable<String> skus);
    }
}